-module(jack_app).

-export([start_link/0]).
-export([get_data/1]).
-export([add_number/2]).

start_link() ->
	{ok, Pid} = gen_event:start_link(),
	%% The scoreboard will always be there
	%% gen_event:add_handler(Pid, curling_scoreboard, []),
	%% Start the stats accumulator
	gen_event:add_handler(Pid, jack_counter, []),
	{ok, Pid}.
 
%% skipping code here
add_number(Pid, N) ->
	gen_event:notify(Pid, {add_number, N}).

%% Returns the current game state.
get_data(Pid) ->
	gen_event:call(Pid, jack_counter, get_data).
